import java.io.Serializable;

class Pack implements Serializable {
    /* Serializable data object to be used for communication between Client & Server.
       This is a simple serialized class used to wrap data */
    public static final long serialVersionUID = 1L;
    
    // Below are the request ID meanings
    public static final long CLOSE_CONNECTION_ID = 0L;
    public static final long CHANGE_PORT_ID      = 1L;
    public static final long REQUEST_ENCRYPT_ID  = 2L;
    public static final long FORWARD_DATA_ID     = 3L;
    
    public final long requestID;
    public final String data;
    public final String fromAddr;
    public final String toAddr;
    
    public Pack(long rID, String dta, String from, String to) {
        this.toAddr = to;
        this.fromAddr = from;
        this.requestID = rID;
        this.data = dta;
    }
    
    public String toString() {
        //return "ID=" + requestID + "::Data=" + data + "::From=" + fromAddr + "::To=" + fromAddr;
        return "---Pack Data---\nID: " + this.requestID + 
               "\nFROM: " + this.fromAddr +
               "\nTO: " + this.fromAddr + 
               "\nData: " + this.data + 
               "\n---------------";
    }
}
